<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%@ Import Namespace="TeamCommunitySolution.Services.Managers.Impl"%>
<%@ Import Namespace="TeamCommunitySolution.Domain.DataLayer.Base"%>

<%
    if (Request.IsAuthenticated && !String.IsNullOrEmpty(Page.User.Identity.Name)) {
      SystemUser user = TeamCommunitySolution.MvcApplication.ApplicationService.UserGetByEmail(Page.User.Identity.Name);
%>
        Welcome <b><%= Html.Encode(string.Format("{0} {1} [ {2} ]", user.FirstName, user.LastName, user.NickName)) %></b>
        [ <%= Html.ActionLink("Log Off", "LogOff", "Account") %> ]
        [ <%= Html.ActionLink("Control Panel", "Profile", "Account") %> ]
<%
    }
    else {
%> 
        [ <%= Html.ActionLink("Log On", "LogOn", "Account") %> ]
<%
    }
%>
